package Easy;

import Structures.TreeNode;

public class LC0700 {
    public TreeNode searchBST(TreeNode root, int val) {
        if (root.val == val) return root;
        if (val <= root.val) {
            if (root.left != null) return searchBST(root.left, val);
            else return null;
        }
        else {
            if (root.right != null) return searchBST(root.right, val);
            else return null;
        }
    }
}
